
def pipe(t):
    return t

def ktoc(t):
    """ Convert K to C """
    return t - 273

def ctok(t):
    """ Convert C to K """
    return t + 273

def ctof(t):
    """ Convert C to F """
    return t * 1.8000 + 32.00

def ftoc(t):
    """ Convert F to C """
    return (t - 32.00) / 1.8000

def ktof(t):
    """ Convert K to F """
    return t * (9/5) - 459.67

def ftok(t):
    """ Convert F to K """
    return (t + 459.67) * 5/9


get_func = {
    'C>C': pipe,
    'C>F': ctof,
    'C>K': ctok,
    'K>K': pipe,
    'K>C': ktoc,
    'K>F': ktof,
    'F>F': pipe,
    'F>C': ftoc,
    'F>K': ftok
}

formuls = {
    "C>K": " t + 273 ",
    "C>F": " t * 1.8000 + 32.00 ",
    "K>C": " t - 273 ",
    "K>F": " t * (9/5) - 459.67 ",
    "F>C": """
t - 32.00
---------
 1.8000
    """,
    "F>K": " (t + 459.67) * 5/9 "
}
